﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSTest.DefaultInterfaceMethod
{
    public interface ICustomer
    {

        IEnumerable<IOrder> PreviousOrders { get; }

        DateTime DateJoined { get; }
        DateTime? LastOrder { get; }
        string Name { get; }
        IDictionary<DateTime, string> Reminders { get; }

        void OriginDemo();
        public void OriginDemo2();

        protected void ProtectDemo();

        public decimal ComputeLoyaltyDiscount() => DefaultLoyaltyDiscount(this);

        public void Demo()
        {
            Console.WriteLine(123123123);
        }


        protected static decimal DefaultLoyaltyDiscount(ICustomer c)
        {
            DateTime start = DateTime.Now;

            if ((c.DateJoined < start) && (c.PreviousOrders.Count() > 1))
            {
                return 1;
            }
            return 0;
        }
    }

    public interface IOrder
    {
        DateTime Purchased { get; }
        decimal Cost { get; }
    }
}
